
import dao.implementations.DaoMsSql;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.logging.Level;
import java.util.logging.Logger;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author Johnny
 */
public class ExampleDao extends DaoMsSql {

    public ArrayList<String> getNodes() {
        ArrayList<String> output = new ArrayList<String>();
        try {
            Statement stmt = getStatement();
            String query = "SELECT * FROM Nodes";
            ResultSet rs = stmt.executeQuery(query);

            while (rs.next()) {
                String item = rs.getInt(1) + " " + rs.getInt(2) + " " + rs.getInt(3);
                output.add(item);
            }

            stmt.close();
        } catch (SQLException ex) {
            Logger.getLogger(ExampleDao.class.getName()).log(Level.SEVERE, null, ex);
        }
        return output;
    }

}
